import pandas as pd



for i in range(1, 8):
    new_df = pd.read_csv(f'{i}.csv')
    old_df = pd.read_csv(f'./merged_output/{i}.csv')
    new_df = new_df[['Date', 'Predicted_Maximum Temperature']]
    old_df = old_df[['date', 'temperture']][-5:]
    old_df.rename(columns={'temperture': 'temperature'}, inplace=True)
    new_df.rename(columns={'Date': 'date'}, inplace=True)
    new_df.rename(columns={'Predicted_Maximum Temperature': 'temperature'}, inplace=True)
    df = pd.concat([old_df, new_df], axis=0)
    print(df)
    df.to_csv(f'./temperature/{i}.csv', index=False)